package com.yonyou.common.service.messagecenter.rabbitmq.entity;

import java.util.UUID;

import net.sf.json.JSONObject;

public class MessageProtocol {
	private String appid;
	private String messageid;
	private String messagecontent;
	private String occurtime;
	private String sign;
	private String nonce;
	public MessageProtocol(){
		//messageid=UUID.randomUUID().toString();
	}
	
	public String getNonce() {
		return nonce;
	}

	public void setNonce(String nonce) {
		this.nonce = nonce;
	}

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

	public String getMessageid() {
		return messageid;
	}

	public void setMessageid(String messageid) {
		this.messageid = messageid;
	}

	public String getMessagecontent() {
		return messagecontent;
	}

	public void setMessagecontent(String messagecontent) {
		this.messagecontent = messagecontent;
	}

	public String getOccurtime() {
		return occurtime;
	}

	public void setOccurtime(String occurtime) {
		this.occurtime = occurtime;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public static String parseMessageId(String data){

		JSONObject obj=JSONObject.fromObject(data);
		Object id=obj.get("msgId");
		if(id==null) id="";
		return (String)id;
	}
/*	public static String parseType(String data){
		JSONObject obj=JSONObject.fromObject(data);
		Object id=obj.get("type");
		if(id==null) id="";
		return (String)id;
	}
	public static String parseSign(String data){

		JSONObject obj=JSONObject.fromObject(data);
		Object id=obj.get("sign");
		if(id==null) id="";
		return (String)id;
	}
	public static String parseAppid(String data){

		JSONObject obj=JSONObject.fromObject(data);
		Object id=obj.get("appid");
		if(id==null) id="";
		return (String)id;
	}*/
}
